﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace gpao2012
{
    public partial class listedesmachines : DevExpress.XtraEditors.XtraUserControl
    {
        public listedesmachines()
        {
            InitializeComponent();
        }

        private void listedesmachines_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'gpaogscofficielDataSet.machine' table. You can move, or remove it, as needed.
            this.machineTableAdapter.Fill(this.gpaogscofficielDataSet.machine);
            this.barstatustext.ForeColor = System.Drawing.Color.Black;
            barstatustext.Text = "Prêt.";

        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            try
            {
                this.Validate();
                this.machineBindingSource.EndEdit();
                this.machineTableAdapter.Update(this.gpaogscofficielDataSet.machine);
                this.barstatustext.ForeColor = System.Drawing.Color.Lime;
                barstatustext.Text = "Enregistrement éffectué";

            }
            catch (System.Exception ex)
            {
                this.barstatustext.ForeColor = System.Drawing.Color.Red;
                barstatustext.Text = "Erreur";
            }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            
        }
    }
}